#pragma once

#include <memory>
#include <functional>

#include "../Network/MNN.h"

using namespace std;

class BP
{
public:
	BP() = delete;

	BP(shared_ptr<CMNN> network, double impulseParam, function<double(int)> backfireFunction, double EPS);

public:
	void Training(Vector Input, Vector ExceptOutput);

protected:
	bool CheckError(Vector error);

protected:
	shared_ptr<CMNN> m_Network;

	double m_ImpulseParam;

	function<double(int)> m_BackfireFunction;

	double m_EPS;

	shared_ptr<Vector> m_pMeanSquareError;

	unsigned long m_ErrorN;
};